Skip to content

fix require doc generator#1850

Open
Baxromumarov wants to merge 1 commit intostretchr:masterfrom
Baxromumarov:fix-require-doc-generation
Open

fix require doc generator#1850
Baxromumarov wants to merge 1 commit intostretchr:masterfrom
Baxromumarov:fix-require-doc-generation

Conversation

@Baxromumarov
Copy link

@Baxromumarov Baxromumarov commented Feb 14, 2026

Summary

The doc comments for multiple functions in the require package have code examples that are invalid. Example, function doesn't return anything but in the comment it says it return bool value:

testify/require/require.go

Lines 1391 to 1394 in 3f28143

// if require.NoError(t, err) {
// require.Equal(t, expectedObj, actualObj)
// }
func NoError(t TestingT, err error, msgAndArgs ...interface{}) {

Changes

Changed require.go.tmpl, require_forward.go.tmpl added new generator for them

Motivation

There was a related issue, and the misleading comments needed to be fixed
Issue #1776

@Baxromumarov Baxromumarov changed the title fix require doc generator #1776 fix require doc generator Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants